package com.demo.travel.activity;

import butterknife.BindView;

import com.demo.travel.R;
import com.demo.travel.base.BaseActivity;
import com.demo.travel.fragment.EventFragment;
import com.demo.travel.fragment.LiveFragment;
import com.demo.travel.fragment.MainFragment;
import com.demo.travel.fragment.MineFragment;
import com.demo.travel.fragment.NewsFragment;
import com.demo.travel.widget.BottomBar;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 */
public class MainActivity extends BaseActivity {

    @BindView(R.id.bottom_bar)
    BottomBar bottomBar;

    @Override
    protected int initLayout() {
        return R.layout.activity_main;
    }

    @Override
    protected void initView() {

        initBottomBar();
    }

    @Override
    protected void initData() {

    }

    @Override
    public String getActivityTitle() {
        return null;
    }

    private void initBottomBar(){
        bottomBar.setContainer(R.id.fl_container)
                .setTitleBeforeAndAfterColor("#404141", "#209efa")
                .addItem(MainFragment.class,
                        "首页",
                        R.mipmap.shouye,
                        R.mipmap.shouye_s)
                .addItem(NewsFragment.class,
                        "新闻",
                        R.mipmap.xinwen,
                        R.mipmap.xinwen_s)
                .addItem(LiveFragment.class,
                        "生活",
                        R.mipmap.shenghuo,
                        R.mipmap.shenghuo_s)
                .addItem(EventFragment.class,
                        "活动",
                        R.mipmap.huodong,
                        R.mipmap.huodong_s)
                .addItem(MineFragment.class,
                        "我的",
                        R.mipmap.wode,
                        R.mipmap.wode_s)
                .build();
        bottomBar.setIconWidth(20)
                .setIconHeight(20)
                .setTitleSize(12);
    }
}
